Skip to content

Fix interaction between by-name implicits and inlining #6404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2019

Conversation

milessabin
Copy link
Contributor

@milessabin milessabin commented Apr 30, 2019

The construction of the dictionaries needed to support recursive by-name implicit arguments requires trees to be hoisted out of the arguments as they are elaborated. Moving trees around in this way has always been a delicate operation because of the need to maintain correct owner chains.

Inlining and the position checking phase added in 69cf220 complicates this still further because we now have to make the source associated with the hoisted tree match the checkers expectations after it has been moved. This is done by reusing the repositioning logic from the inliner.

The issue this commit fixes only shows up in cases where an inline method is used as part of a by-name implicit argument resolution in a different source file.

The construction of the dictionaries needed to support recursive by-name
implicit arguments requires trees to be hoisted out of the arguments as
they are elaborated. Moving trees around in this way has always been a
delicate operation because of the need to maintain correct owner chains.

Inlining and the position checking phase added in 69cf220 complicates
this still further because we now have to make the source associated
with the hoisted tree match the checkers expectations after it has been
moved. This is done by reusing the repositioning logic from the inliner.

The issue this commit fixes only shows up in cases where an inline
method defined is used as part of a by-name implicit argument resolution
in a different source file.
@nicolasstucki nicolasstucki merged commit 58a36f2 into scala:master May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants